/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Author: Huawei OS Kernel Lab
 * Create: Thu Aug 15 16:14:23 2023
 */

#ifndef __LIBLINUX_ASM_PGTABLE_H
#define __LIBLINUX_ASM_PGTABLE_H

/* Pure hack, will be removed later */
#ifdef CONFIG_ARM64
#define empty_zero_page __empty_zero_page
#endif

#include_next <asm/pgtable.h>

#ifdef CONFIG_ARM64
#undef  empty_zero_page
#endif

/* for liblinux, we can use the entire virtual address space */
#undef  VMALLOC_START
#undef  VMALLOC_END
#define VMALLOC_START (0)
#define VMALLOC_END   (-1UL)

#ifdef CONFIG_ARM
#define pgprot_kernel (0)
#endif

#ifdef CONFIG_ARM64
/* we prefer the arm32 style `empty_zero_page`, which have explict
 * zero-page allocation. See "init/liblinux.c" for details. */
extern struct page *empty_zero_page;
#undef  ZERO_PAGE
#define ZERO_PAGE(vaddr) (empty_zero_page)
#endif

#endif /* __LIBLINUX_ASM_PGTABLE_H */
